r.sim: disable broken nblock usage#7358
Conversation
metzm
left a comment
There was a problem hiding this comment.
The changes look good to me, thanks!
Looking forward to a proposal enabling nblocks > 1.
wenzeslaus
left a comment
There was a problem hiding this comment.
The accumulation as total (sum) as opposed to average is not my first expectation when replica term is used, but with explanation it makes sense as result being an aggregate of multiple replicas (just not the average aggregate). The extrapolated total makes sense in that context although this will probably change with parallel. I'm not sure about the error computation (I did not dive into it).
Considering nblocks is 1 and parallelization needing more rewrite, the current PR is good and makes things consistent within the code. (The sync to original Fortran makes sense too; the code here drifted based on the nblock issue.)
Note: "...produced biased depth..." sounds like this belongs to Errata.
TL;DR
Disabled the broken nblock >1 auto-split in r.sim.water/r.sim.sediment by forcing nblock=1. Kept the variables so that nblocks functionality can be enabled in follow up PRs.
Fixed the err formula to the original fortran's Monte Carlo stddev (fixes #4799). As a result error map is now 0 and will become more useful once nblocks will be enabled to be > 1.
Background
nblock originated in the Fortran ancestor as a memory workaround for running more walkers than the static buffer held; the C port inherited the structure but eventually mangled the per-block walker
accounting (rwalk was never actually divided), silently producing biased depth/discharge for users beyond the MAXW cap.
Summary of changes
sqrt(|E[(gama·conn)²]/nblock − gama²|)); previously the C port had a wrong exponent and a missingpost-loop step that produced a quantity with no clean meaning (fixes [Bug] r.sim.water: error output is not error but sum of depths? #4799). With nblock = 1 today it's zero everywhere; it becomes meaningful when nblock > 1 is reintroduced.
and outputs are unchanged.
Behavior changes
to all-zeros (correct stddev for one sample).
Not in this PR